hunt_count = 0 # count hunt from the beginning
slack_count = 0 # count slack from the beginning

def hunt_choices(round_number, current_food, current_reputation, m, player_reputations):
	
	global hunt_count # += 1 for hunt decision
	global slack_count # += 1 for slack decision
	hunt_decisions = ['s' for x in player_reputations]
	
	if round_number == 1: # first round, hunt only with 75% of the people
			hunt_num = len(player_reputations) * 0.75
			i = 0
			while i < len(player_reputations):
				if i < hunt_num:
					hunt_decisions[i] = 'h'
					hunt_count += 1
				else:
					hunt_decisions[i] = 's'
					slack_count += 1
				i += 1

	elif len(player_reputations) == 6: # slack when there's 6 players left
		for i, x in enumerate(player_reputations):
			hunt_decisions[i] = 's'
			slack_count += 1
		
	elif len(player_reputations) < 10: # slack 50% of the time
		how_many = len(player_reputations) / 2
		how_many = how_many.ceil()
		max_list = max_func(player_reputations, 1, how_many) # get 50% (little more when there's odd number of players) of number of players
		
		for i, x in enumerate(player_reputations): # if the index is in max_list, choose to hunt
			if i in max_list:
				hunt_decisions[i] = 'h'
			else:
				hunt_decisions[i] = 's'
		
	elif len(player_reputations) < 30: # less than 30 players hunt with players of reputation 0.6 above
		for i, x in enumerate(player_reputations):
			if x > 0.6 and x != 1:
				hunt_decisions[i] = 'h'
				hunt_count += 1
			else:
				hunt_decisions[i] = 's'
				slack_count += 1
		
	else: # 30 or more people
			for i, x in enumerate(player_reputations): # slack only if reputation is 1 or 0.5 or less
				if x == 1 or x <= 0.5:
					hunt_decisions[i] = 's'
					slack_count += 1
				else:
					hunt_decisions[i] = 'h'
					hunt_count += 1
	
	while get_reputation <= 0.5 and len(player_reputation) > 6: # keep reputation above 0.5
		if len(player_reputations) < 30: # get highest reputation that's below the threshold (getting better ones among bad ones)
			max_index = max_func(p_reputations, 0.6, 1)
		else:
			max_index = max_func(p_reputations, 0.5, 1)
			
		p_reputation[max_index] = 'h'
		hunt_count += 1
		slack_count -= 1
		
	return hunt_decisions
	
def get_reputation(c_hunt, c_slack): # get reputation after this round
	
	reputation = c_hunt / (c_slack + c_hunt)
	return reputation
	
def max_func(p_reputations, under, how_many): # get certain numbers of highest numbers that are below a certain number
	
	max_list = []
	i = 0
	while i < how_many:
		
		max_num = max(p_reputations)
		max_index = p_reputations.index(max_num)
		
		if max_num <= under:
			max_list[i] = max_index
			i += 1
			
		p_reputations[max_index] = min(p_reputations) - 1
	
	return max_list
	
def hunt_outcomes(food_earnings):
    pass # do nothing

def round_end(award, m, number_hunters):
    pass # do nothing